<template id="pay">
	<div class="pay">
		
		
		<!--头部-->
		<div class="about_header">

			<div class="about_title">
				<router-link to="/shop_cart"><img src="../../assets/images/class/jiantou_03.png" /></router-link>

				<p>付款台</p>
				<div class="about_select">
					<div class="about_ing"></div>
				</div>

			</div>
		</div>
		<!--头部结束-->
		
		<!--待支付金额-->
		<div class="pay_sum">
			<p>待支付金额</p>
			<div class="pay_amount"><img src="../../assets/images/my_order/my_order_19.png"/><span>248.00</span></div>
			<div class="pay_data">剩余支付时间：<span>00.14.30</span></div>
		</div>
		<!--待支付金额结束-->
		
		
		<!--支付方式-->
		<div class="pay_mode">
			<p>支付方式</p>
			
			<div class="pay_pattern">
			
			<div class="pay_weixin">
				<div class="pay_left"><img src="../../assets/images/pay/pay_11.png"/><span>微信支付</span></div>
				<div class="pay_right" @click="Pay(0)"><img src="../../assets/images/pay/pay_21.png"  v-if="pay=='1'||pay=='2'" /><img src="../../assets/images/pay/pay_14.png"v-if="pay=='0'"/></div>
			</div>
			
			<div class="pay_weixin">
				<div class="pay_left"><img src="../../assets/images/pay/pay_19.png"/><span>余额支付</span></div>
				<div class="pay_right" @click="Pay(1)"><img src="../../assets/images/pay/pay_21.png" v-if="pay=='0'||pay=='2'"/><img src="../../assets/images/pay/pay_14.png" v-if="pay=='1'" @click.stop="paySum"/></div>
			</div>
			
			<div class="pay_weixin">
				<div class="pay_left"><img src="../../assets/images/pay/pay_25.png"/><span>支付宝支付</span></div>
				<div class="pay_right"  @click="Pay(2)"><img src="../../assets/images/pay/pay_21.png" v-if="pay=='1'||pay=='0'"/><img src="../../assets/images/pay/pay_14.png" v-if="pay=='2'"/></div>
			</div>
			
			
				
				
			</div>
			
			
			
		</div>
		<!--支付方式结束-->
		
		
		<!--微信支付248元-->
		<div class="pay_to">微信支付248.00元</div>
		<!--微信支付248元结束-->
		
		
		
		
	</div>
</template>

<script>
	export default {
     data() {
            return{
               pay: '0' ,
               sessionid: window.localStorage.getItem('SESSION_ID'),
				coachid: this.$route.query.coachid,
				userid: 100343,
				code: 1
               
            }
       },
      
  methods:{
	Pay: function (index){
		this.pay = index
	},
	paySum(){
		let obj = {
				//请求的参数
				bookingid:'201809078516362118',
			  sessionid: "A36DE0A818CC784A4B6C515512A861D7",
				coachid: 89036,
				userid: 106720,
				code: 1,
				cashPrice:'258',
				couponid:'0'

			};
			var _this = this
			let qs = require('qs');
			this.$axios.post("/yujia/user/userBalancePayment", qs.stringify(obj), {
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				}
				//重写headers 请求头  qs.stringify(json对象) 把对象转化为字符串 
			}).then(function(response) {
				console.log(response)
			}).catch(function(error) {
				console.log(error);
			});
	}
  }
}
</script>

<style scoped>
@import "../../assets/css/pay.css";
</style>